// 函数组合
function compose(f, g) {
  return function (value) {
    return f(g(value))
  }
}

function reverse(ary) {
  return ary.reverse();
}

function first(ary) {
  return ary[0]
}

const last = compose(first, reverse);

const list = ['a', 'b', 'c', 'd'];
console.log(last(list))


